public class DiffThread{

    public static void main(String[] args){

        System.out.println("---- thread method ----");   
        MyThread mt1 = new MyThread();
        MyThread mt2 = new MyThread();

        mt1.start();
        mt2.start();

    }

}

class MyThread extends Thread{

    private int count = 5;

    public void run(){
        while(count > 0){
            System.out.println(Thread.currentThread().getName() + " count = " + count--);
        }
    }

}